<?php
?>

<script type="text/javascript" language="javascript"  src="js/jquery.js"></script>
<script type="text/javascript" language="javascript">
function start_ajax(){
	var url="http://www.y.com/demo_ajax_recieve.php?num=1";
	$.get(url,call_back_func,'json');
}
function call_back_func(_json){	
	$('#ajax_msg').text(_json['msg']);
	$('#ajax_num').text(_json['num']);
	if(typeof(_json['url'])!='undefined' &&_json['url']!=null && _json['url']!='' ){
		//alert(_json['url']);
		$.get(_json['url'],call_back_func,'json');
	}
}
</script>
<table>
<tr>
<td>ajax次数：</td>
<td>
<span id="ajax_num">0</span>
</td>
</tr>
<tr>
<td>消息内容：</td>
<td>
<span id="ajax_msg">null</span>
</td>
</tr>
</table>
<input type="button"  onclick="start_ajax();" value="请求" id="start_ajax" />